package com.lifei.test;

import com.lifei.HomeworkApplication;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = {HomeworkApplication.class})
public class MyRocketProducer {

    @Autowired
    private RocketMQTemplate rocketMQTemplate;

    @Test
    public void testSendMessage(){
        this.rocketMQTemplate.convertAndSend(
                "tp_springboot_01",
                "springboot: hello liFei"
        );
    }

}
